﻿using UnityEngine;
using System.Collections;

public class GUIObject : MonoBehaviour {
	public GUIController controller;
	public GUIObject currentMenu;
	public GUIObject targetMenu;
	public bool active, isMenu;
	public Vector3 originalPosition;
	// Use this for initialization
	void Start () {
		originalPosition = transform.position;
		if(!active && isMenu) {
			controller.setGUIObjectActive(this, false);
		}
	}

	void OnMouseDown() {
		//Debug.Log (gameObject.name + " pressed");
		// Can't press button while menu is panning
		if(controller.getCurrentScrollSpeed() < 0.1f) {
			controller.sendButtonPress (this);
			controller.deactiveLastMenu = true;
			targetMenu.active = true;
		}
	}

	// Update is called once per frame
	void Update () {
	
	}
}
